<?php
	header("Location:/");
	die();
	require_once("fta.201003310000/fta.php");
	fta_registerModules(
		array(
		"cms.201003310000/config/cmsConfig",//we will deprecate the old cms config soon..
		"site/fta/config",
		"site/components/MAIArtworks",
	));	
	
	$urlfragment = extractStringWithKeyFromArray("urlfragment", $_REQUEST, null);
	//Need to default it to top one if not set or another page.
	if(is_null($urlfragment)){
		header('location: /Artworks-For-Sale/');
	} else {
		$urlfragment = urlFragmentCleanRestore($urlfragment);
	}
	
	//echo "Url fragment = '" . $urlfragment . "' ";
	
	// /*
	//need to redirect if no type found
	$o = mai_getSharedArtworksObject();
	$artwork = $o->getArtworkByUrlFragment($urlfragment);
	if($artwork == false){
		header('location: /Artworks-For-Sale/');
	}
	// */
	
	//echo "Artwork = <pre>";print_r($o->artwork);echo "</pre>";
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="Keywords" content="<?php echo $o->artwork->keywords; /* ?>Mairangi, Arts, Centre, MAC, North Shore, Auckland, New Zealand, education, art classes, exhibitions <?php */ ?>" />
<meta name="Description" content="<?php echo $o->artwork->description; /* ?>Mairangi Arts Centre (MAC) was initiated several years after a group of East Coast Bays residents saw the need for an arts centre in their area. Opened in May 1991, after more than ten years of fundraising, the main gallery, café and office area are housed in the old Mairangi War Memorial Hall (opened 1953). The building ,once used as the headquarters for a local soccer club, after extensive refurbishment, was transformed into a light and spacious environment.<? */ ?>" />

<title><?php echo $o->artwork->title; ?> - Artwork for Sale | Mairangi Arts Centre</title>

<?php include ("includes/external-files.php"); ?>

<link type="text/css" media="screen" rel="stylesheet" href="/js/colorbox/colorbox.css" />
<script type="text/javascript" src="/js/colorbox/jquery.colorbox.js"></script>
<script type="text/javascript">
	$(document).ready(function(){
		$(".popup").colorbox({iframe:true, width:"700", height:"710px"});
	});
</script>


<?php include ("includes/analytics.php"); ?>   
</head>

<body id="artwork" class="">



<?php include ("includes/head.php"); ?>





<div id="container">


	<div id="content">


        <div id="page-nav">
        	<?php
        	$o->previousNextArtworkByUrl($urlfragment);
        	
        	if(!is_null($o->previousArtworkTitle)){
        	?>
        	<a href="/Artworks-For-Sale/<?php echo urlFragmentClean($o->previousArtworkTitle); ?>/" title="Previous artwork">Previous artwork</a>
        	<?php
        	}
        	
        	if(!is_null($o->nextArtworkTitle)){
        	?>
        	<a id="next-artwork" href="/Artworks-For-Sale/<?php echo urlFragmentClean($o->nextArtworkTitle); ?>/" title="Next artwork">Next artwork</a>
        	<?php
			}
        	?>
		</div>



        <h1><a href="/Artworks-For-Sale/">Artworks for sale</a></h1>
		
        


        <div id="artwork-img">
            <img src="/html/blob.php?documentCode=<?php echo $o->artwork->documentcode; ?>&elementId=20200&filetypecode=3" />
            <a id="artwork-listing" href="/Artworks-For-Sale/" title="Back to listing">Back to listing</a>
        </div>



        <div id="artwork-copy">
 	       <h2><?php echo $o->artwork->title; ?></h2>
           <?php echo $o->artwork->shortdescription; ?>
           
           
           
           <div id="buy-enquire">
               <div id="price">$<?php echo $o->artwork->extra14; ?></div>
               <a class="popup" id="enquire-artwork" href="/Artworks-For-Sale/Enquire/<?php echo urlFragmentClean($o->artwork->title); ?>/" title="Enquire about this artwork &gt;">Enquire about this artwork &gt;</a>
               <div id="or-type">or</div>
               
               <form method="post" action="/Cart/" enctype="multipart/form-data">
					<input type="hidden" name="orderStep" value="orderItem" />
					<input type="hidden" name="productId" value="<?php echo $o->artwork->documentcode; ?>" />
					<input type="hidden" name="returnUrl" value="/Artworks-For-Sale/<? echo urlFragmentClean($o->artwork->title) . "/"; ?>" />
					<input type="hidden" name="quantity" value="1" />	
               		
					<input  id="buy-artwork" name="buy-artwork" type="submit" />
               </form>
           </div>
           
           
        </div>
        
        
        	
        
        
        
        
        
                    

        
        
        
    
    
    
    	<div id="supplementary-content">
            

            
        </div><!-- Supplementary-content ends -->



    </div><!-- Content ends -->








    
</div><!-- Container ends -->





<?php include ("includes/foot.php"); ?>





</body>

</html>
